<template>
  <view class="content">
    <image class="logo" src="/static/logo.png" />
    <view class="text-area">
      <!-- <text class="title">{{ title }}</text> -->
    </view>
    <view class="text-area">
      <text class="title">{{ name22 }}</text>
    </view>
    <view>name: {{ name }}</view>
    <view>fullName: {{ fullName }}</view>
    <view @click="updateNameFn">updateName</view>

    <view>
      <view>title:{{ title }}</view>
      <view @click="changeTitle(Math.round(Math.random()* 1000))">changeTitle</view>
    </view>
  </view>
</template>

<script setup lang="ts">
  import { useTitle } from '@/hooks/useTitle';
  const { title, changeTitle } = useTitle()

  const setupStore = useSetupStore();
  const { name, fullName } =  useSetupStore();
  // const title = ref('Hello DEMO')
  const name22 = ref('name22');
  function updateNameFn() {
    let str = Math.round(Math.random() * 1000) + ' newName';
    setupStore.updateName(str)
    console.log('setupStore', setupStore.name)
    name22.value = setupStore.name
  }
</script>

<style>
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.logo {
  height: 200rpx;
  width: 200rpx;
  margin-top: 200rpx;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 50rpx;
}

.text-area {
  display: flex;
  justify-content: center;
}

.title {
  font-size: 36rpx;
  color: #8f8f94;
}
</style>
